public class test3 {
    //斐波那契数
    public static void main(String[] args) {
        System.out.println(fib(1));
    }
    public static int fib(int n) {
        if(n==0) return 0;
        int a = 1,b=1;
        //1,1,2,3,5,8
        while(n>2){
            b = a+b;
            a = b-a;
            n--;
        }
        return b;
    }
}
